package com.test;

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        List<Integer> list1 = new ArrayList<>();
        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.remove((Object)1);
        System.out.println(list1);
        List<Integer> list2 = new LinkedList<>();
        List<Integer> stack = new Stack<>();

        Set<Integer> set1 = new HashSet<>();
        Set<Integer> set2 = new LinkedHashSet<>();
        Set<Integer> set3 = new TreeSet<>();

        Map<Integer,Integer> map = new HashMap<>();
        Map<Integer,Integer> linkedMap1 = new TreeMap<>();
        Map<Integer,Integer> linkedMap2 = new LinkedHashMap<>();
    }

    public void FindNumsAppearOnce(int[] array, int num1[], int num2[])
    {
        int length = array.length;
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < length; i++)
        {
            if (set.contains(array[i]))
            {
                set.remove(array[i]);
            }
            else
            {
                set.add(array[i]);
            }
        }
        Iterator it = set.iterator();
        num1[0] = (int) it.next();
        num2[0] = (int) it.next();
    }

    public static int sum(ArrayList<Integer> list)
    {
        int temp = 0;
        for (int i = 0; i < list.size(); i++)
        {
            temp += list.get(i);
        }
        return temp;
    }

}
